#ifndef MENCODERPROVIDER_H
#define MENCODERPROVIDER_H

#include "encoderprovider.h"
#include "mencoder_global.h"

#include <QObject>
#include <QHash>
#include <QList>
#include <QWidget>

class MENCODERSHARED_EXPORT MencoderProvider: public EncoderProvider {
    Q_OBJECT
public:
    MencoderProvider();

    virtual const char *name () const { return "mencoder"; }
    virtual const EncoderProviderVersion * version () const;
    virtual QString author() const { return "Liu Fanchao @ LFC Invention"; }
    virtual QString displayName() const { return QObject::tr("mencoder"); }
    virtual QString authorSite() const { return "http://blog.simophin.net"; }
    virtual QString introduction() const;

    virtual QStringList availableVideoCodecFormat() const;
    virtual QStringList availableAudioCodecFormat() const;

    virtual QWidget *configWidgetForVideoCodec(const QString &, const EncoderOption &) ;
    virtual QWidget *configWidgetForAudioCodec(const QString &, const EncoderOption &) ;

    virtual EncoderOption * createOption(EncoderOption *copy = NULL);


    virtual void testAvailablityForFile(const QString &file, EncoderAvailablity &av);
    virtual bool startConvert(QStringList &file);

private:
    QList<EncoderOption *> m_otherOptions;

    EncoderProviderVersion m_version;
    QStringList m_videoCodecFormats, m_audioCodecFormats;

    QHash< QString, QHash<QString,QWidget *> >
	    m_videoConfigWidgets, m_audioConfigWidgets;


    int m_optionInc;

    void setup ();
    QWidget * createSettingWidget(const QString &);

private slots:
    void onConfigWidgetDestroyed(QObject *obj);

};

extern "C" EncoderProvider * createProvider(const QString &);

#endif // MENCODERPROVIDER_H
